<?php


namespace app\commands;


use app\models\order\Order;
use yii\console\Controller;

class DataController extends Controller
{
    public function actionIndex()
    {
        // 1 order -> reset -> commission status = 1
        // 2 account -> +refill  +commission -> -consume

        $orders = Order::find()
            ->where(['!=', 'status', [0, 6, -99]])
            ->all();

        $count = 1;
        foreach ($orders as $order) {
            // echo $order->id, ' - ', $count++,  "\n";

            $this->execute($order);
        }
    }

    protected function execute(Order $order)
    {
        $log = $order->log;

        if ($log) {
            var_dump($log);exit;
        }
    }
}